#!/usr/bin/perl

if ( @ARGV > 1 && -d $ARGV[0] )
{
  $path = $ARGV[0];
  $path =~ s/\\/\//g;
  $path =~ s/\/\/*/\//g;
  $path =~ s/\/$//;
  $offset = $ARGV[1];
  $offset =~ s/\\/\//g;
  $offset =~ s/\/\/*/\//g;
  $offset =~ s/\/$//;

  open(XXX, "cd \"$path\" && find \"$offset\" -type f|");
  while (<XXX>)
  {
    chomp;
    system("cd \"$path\" && md5sum -b \"$_\"");
  }
  close(XXX);
}
